package ilearn.job.ilearnjobgrayversionjava17.buss.feign;

import ilearn.job.ilearnjobgrayversionjava17.buss.config.GrayVersionConfig;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "order-server")
@LoadBalancerClient(name = "order-server",configuration = GrayVersionConfig.class)
public interface OrderFeigh {

    @GetMapping("/getOrderInfo")
    String getOrderInfo(@RequestParam("userId")String userId, @RequestHeader("version")String version);

    @GetMapping("/getOrderInfo")
    String getOrderInfoByParmVersion(@RequestParam("userId")String userId, @RequestParam("version")String version);

    @GetMapping("/v={version}/getOrderInfo")
    String getOrderInfoByPathVersion(@RequestParam("userId")String userId, @PathVariable("version")String version);

    @GetMapping("/getOrderInfo")
    String getOrderInfoByCookieVersion(@RequestParam("userId")String userId, @CookieValue("version")String version);

}
